﻿namespace WinnerCMS.Common.Security.CodeCharts
{
    using Security;
    using System;
    using System.Collections;

    internal static class Middle
    {
        public static IEnumerable Arrows()
        {
            return CodeChartHelper.GetRange(0x2190, 0x21ff);
        }

        public static IEnumerable BlockElements()
        {
            return CodeChartHelper.GetRange(0x2580, 0x259f);
        }

        public static IEnumerable BoxDrawing()
        {
            return CodeChartHelper.GetRange(0x2500, 0x257f);
        }

        public static IEnumerable BraillePatterns()
        {
            return CodeChartHelper.GetRange(0x2800, 0x28ff);
        }

        public static IEnumerable CombiningDiacriticalMarksForSymbols()
        {
            return CodeChartHelper.GetRange(0x20d0, 0x20f0);
        }

        public static IEnumerable ControlPictures()
        {
            return CodeChartHelper.GetRange(0x2400, 0x2426);
        }

        public static IEnumerable Coptic()
        {
            return CodeChartHelper.GetRange(0x2c80, 0x2cff, i => (i >= 0x2cf2) && (i <= 0x2cf8));
        }

        public static IEnumerable CurrencySymbols()
        {
            return CodeChartHelper.GetRange(0x20a0, 0x20b8);
        }

        public static IEnumerable Dingbats()
        {
            return CodeChartHelper.GetRange(0x2701, 0x27be, delegate (int i) {
                if (((((i != 0x2705) && (i != 0x270a)) && ((i != 0x270b) && (i != 0x2728))) && (((i != 0x274c) && (i != 0x274e)) && ((i != 0x2753) && (i != 0x2754)))) && ((((i != 0x2755) && (i != 0x275f)) && ((i != 0x2760) && (i != 0x2795))) && ((i != 0x2796) && (i != 0x2797))))
                {
                    return i == 0x27b0;
                }
                return true;
            });
        }

        public static IEnumerable EnclosedAlphanumerics()
        {
            return CodeChartHelper.GetRange(0x2460, 0x24ff);
        }

        public static IEnumerable EthiopicExtended()
        {
            return CodeChartHelper.GetRange(0x2d80, 0x2dde, delegate (int i) {
                if (((i < 0x2d97) || (i > 0x2d9f)) && ((((i != 0x2da7) && (i != 0x2daf)) && ((i != 0x2db7) && (i != 0x2dbf))) && (((i != 0x2dc7) && (i != 0x2dcf)) && (i != 0x2dd7))))
                {
                    return i == 0x2ddf;
                }
                return true;
            });
        }

        public static IEnumerable GeneralPunctuation()
        {
            return CodeChartHelper.GetRange(0x2000, 0x206f, i => (i >= 0x2065) && (i <= 0x2069));
        }

        public static IEnumerable GeometricShapes()
        {
            return CodeChartHelper.GetRange(0x25a0, 0x25ff);
        }

        public static IEnumerable GeorgianSupplement()
        {
            return CodeChartHelper.GetRange(0x2d00, 0x2d25);
        }

        public static IEnumerable Glagolitic()
        {
            return CodeChartHelper.GetRange(0x2c00, 0x2c5e, i => i == 0x2c2f);
        }

        public static IEnumerable GreekExtended()
        {
            return CodeChartHelper.GetRange(0x1f00, 0x1ffe, delegate (int i) {
                if ((((((i != 0x1f16) && (i != 0x1f17)) && ((i != 0x1f1e) && (i != 0x1f1f))) && (((i != 0x1f46) && (i != 0x1f47)) && ((i != 0x1f4e) && (i != 0x1f4f)))) && ((((i != 0x1f58) && (i != 0x1f5a)) && ((i != 0x1f5c) && (i != 0x1f5e))) && (((i != 0x1f7e) && (i != 0x1f7f)) && ((i != 0x1fb5) && (i != 0x1fc5))))) && ((((i != 0x1fd4) && (i != 0x1fd5)) && ((i != 0x1fdc) && (i != 0x1ff0))) && (i != 0x1ff1)))
                {
                    return i == 0x1ff5;
                }
                return true;
            });
        }

        public static bool IsFlagSet(MidCodeCharts flags, MidCodeCharts flagToCheck)
        {
            return ((flags & flagToCheck) != MidCodeCharts.None);
        }

        public static IEnumerable LatinExtendedC()
        {
            return CodeChartHelper.GetRange(0x2c60, 0x2c7f);
        }

        public static IEnumerable LetterlikeSymbols()
        {
            return CodeChartHelper.GetRange(0x2100, 0x214f);
        }

        public static IEnumerable MathematicalOperators()
        {
            return CodeChartHelper.GetRange(0x2200, 0x22ff);
        }

        public static IEnumerable MiscellaneousMathematicalSymbolsA()
        {
            return CodeChartHelper.GetRange(0x27c0, 0x27ef, delegate (int i) {
                if (((i != 0x27cb) && (i != 0x27cd)) && (i != 0x27ce))
                {
                    return i == 0x27cf;
                }
                return true;
            });
        }

        public static IEnumerable MiscellaneousMathematicalSymbolsB()
        {
            return CodeChartHelper.GetRange(0x2980, 0x29ff);
        }

        public static IEnumerable MiscellaneousSymbols()
        {
            return CodeChartHelper.GetRange(0x2600, 0x26ff, i => ((i == 0x26ce) || (i == 0x26e2)) || ((i >= 0x26e4) && (i <= 0x26e7)));
        }

        public static IEnumerable MiscellaneousSymbolsAndArrows()
        {
            return CodeChartHelper.GetRange(0x2b00, 0x2b59, delegate (int i) {
                if ((i != 0x2b4d) && (i != 0x2b4e))
                {
                    return i == 0x2b4f;
                }
                return true;
            });
        }

        public static IEnumerable MiscellaneousTechnical()
        {
            return CodeChartHelper.GetRange(0x2300, 0x23e8);
        }

        public static IEnumerable NumberForms()
        {
            return CodeChartHelper.GetRange(0x2150, 0x2189);
        }

        public static IEnumerable OpticalCharacterRecognition()
        {
            return CodeChartHelper.GetRange(0x2440, 0x244a);
        }

        public static IEnumerable SuperscriptsAndSubscripts()
        {
            return CodeChartHelper.GetRange(0x2070, 0x2094, delegate (int i) {
                if ((i != 0x2072) && (i != 0x2073))
                {
                    return i == 0x208f;
                }
                return true;
            });
        }

        public static IEnumerable SupplementalArrowsA()
        {
            return CodeChartHelper.GetRange(0x27f0, 0x27ff);
        }

        public static IEnumerable SupplementalArrowsB()
        {
            return CodeChartHelper.GetRange(0x2900, 0x297f);
        }

        public static IEnumerable SupplementalMathematicalOperators()
        {
            return CodeChartHelper.GetRange(0x2a00, 0x2aff);
        }

        public static IEnumerable Tifinagh()
        {
            return CodeChartHelper.GetRange(0x2d30, 0x2d6f, i => (i >= 0x2d66) && (i <= 0x2d6e));
        }
    }
}

